﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="TeamList.aspx.cs" Inherits="AB.ServiceDirectory.Design.TeamMaintenance.TeamList" %>

<asp:Content ID="head" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(function () {
            $("#tabs").tabs();
        });
    </script>
</asp:Content>
<asp:Content ID="ContentTitle" ContentPlaceHolderID="ContentTitle" runat="server">
    <h2>
        Team List</h2>
</asp:Content>
<asp:Content ID="Content" ContentPlaceHolderID="Content" runat="server">
    <div class="grid740 simplebox relative">
        <div id="tabs">
            <ul>
                <li>
                    <asp:HyperLink ID="LinkDetails01" NavigateUrl="#DetailsPanel01" runat="server">Details</asp:HyperLink></li>
                <li>
                    <asp:HyperLink ID="TeamsPanel" NavigateUrl="#DetailsPanel02" runat="server">Teams</asp:HyperLink></li>
            </ul>
            <span class="top-right-cornor">
                <asp:Button CssClass="st-button" ID="ButtonInactive" runat="server" Text="In-active" />
                <asp:Button CssClass="st-button" ID="ButtonSave" runat="server" Text="Save" 
               />
                <asp:Button CssClass="st-button" ID="ButtonBack" runat="server" Text="Back" PostBackUrl="~/TeamMaintenance/TeamList.aspx"
                    CausesValidation="False" />
            </span>
            <%--1 label bắt buộc phải có css class là st-labeltext level1--%>
            <%--1 textbox bắt buộc phải có css class là st-forminput và Width từ 150 > 200--%>
            <%--DETAIL PANEL 01--%>
            <asp:Panel ID="DetailsPanel01" ClientIDMode="Static" runat="server">
                <%--Mỗi một dòng có đường kẻ ngang là một div với class st-form-line-noleft--%>
                <div class="st-form-line-noleft">
                    <%--Phần bên trái của 1 dòng là 1 label và 1 textbox, checkbox,...--%>
                    <div class="half">
                        <asp:Label ID="LabelTeamName" runat="server" Text="Team Name" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxOrganisationName">
                          <%--  <asp:RequiredFieldValidator ID="RequiredOrganizationName" runat="server" ErrorMessage="*"
                                SetFocusOnError="true" ForeColor="red" ControlToValidate="TextBoxOrganizationName" />--%>
                        </asp:Label><asp:TextBox ID="TextBoxOrganisationName" CssClass="st-forminput" runat="server"
                            Width="200px"></asp:TextBox></div>
                    <%--Phần bên phải tương tự nhưng có thêm class là last--%><div class="half last">
                        <asp:Label ID="LabelTypeOfBusiness" runat="server" Text="Type of Business" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxTypeOfBusiness">
                          
                        </asp:Label><asp:TextBox ID="TextBoxTypeOfBusiness" CssClass="st-forminput st-disable"
                            runat="server" Width="150px"></asp:TextBox></div>
                    <%--Bắt buộc phải có phần này sau 2 thẻ div có class là half--%><div class="clear">
                    </div>
                </div>
                <%--Mỗi một dòng có đường kẻ ngang là một div với class st-form-line-noleft--%>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="LabelShortDescription" runat="server" Text="Team Short Description"
                            CssClass="st-labeltext level1" AssociatedControlID="TextBoxShortDescription">
                           
                        </asp:Label><asp:TextBox ID="TextBoxShortDescription" CssClass="st-forminput" runat="server"
                            Width="200px" TextMode="MultiLine" Rows="3"></asp:TextBox></div>
                    <div class="half last">
                        <asp:Label ID="LabelSicCode" runat="server" AssociatedControlID="TextBoxSicCode"
                            CssClass="st-labeltext level1" Text="SIC"></asp:Label><asp:TextBox ID="TextBoxSicCode"
                                runat="server" CssClass="st-forminput st-disable" Width="50px"></asp:TextBox><br />
                    </div>
                    <div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="LabelLeadContact" runat="server" Text="Lead Contact" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxLeadContact"></asp:Label><asp:TextBox ID="TextBoxLeadContact"
                                CssClass="st-forminput st-disable" runat="server" Width="150px"></asp:TextBox><asp:LinkButton
                                    ID="ButtonContactLookup" runat="server" CssClass="hg-blue" Text="Lookup" CausesValidation="False" />
                    </div>
                    <div class="half last">
                    </div>
                    <div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="Label2" AssociatedControlID="RadioButtonList1" CssClass="st-labeltext level1-5"
                            runat="server" Text="Copy address from"></asp:Label><asp:RadioButtonList ID="RadioButtonList1"
                                runat="server" RepeatDirection="Horizontal" CssClass="left" Width="165px">
                                <asp:ListItem>Organization</asp:ListItem>
                                <asp:ListItem>Parent</asp:ListItem>
                            </asp:RadioButtonList>
                        <br />
                        <br />
                        <asp:Label ID="LabelAddressLine1" runat="server" Text="Address Line 1" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxAddressLine1">
                            <asp:RequiredFieldValidator ID="RequiredAddressLine1" runat="server" ErrorMessage="*"
                                SetFocusOnError="true" ForeColor="red" ControlToValidate="TextBoxAddressLine1" />
                        </asp:Label><asp:TextBox ID="TextBoxAddressLine1" CssClass="st-forminput" runat="server"
                            Width="200px"></asp:TextBox><br /><br /><asp:Label ID="LabelAddressLine2" runat="server" Text="Address Line 2" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxAddressLine2"></asp:Label><asp:TextBox ID="TextBoxAddressLine2"
                                CssClass="st-forminput" runat="server" Width="200px"></asp:TextBox><br /><br /><asp:Label ID="LabelAddressLine3" runat="server" Text="Address Line 3" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxAddressLine3"></asp:Label><asp:TextBox ID="TextBoxAddressLine3"
                                CssClass="st-forminput" runat="server" Width="200px"></asp:TextBox></div><div class="half last">
                        <asp:Label ID="LabelFullDescription" runat="server" Text="Full Description" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxFullDescription"></asp:Label><asp:TextBox ID="TextBoxFullDescription"
                                CssClass="st-forminput" runat="server" Width="200px" TextMode="MultiLine" Rows="3"></asp:TextBox><br /><br /><asp:Label ID="LabelPhoneNumber" runat="server" Text="Phone Number" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxPhoneNumber">
                        </asp:Label><asp:TextBox ID="TextBoxPhoneNumber" CssClass="st-forminput" runat="server"
                            Width="200px"></asp:TextBox></div><div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="LabelPostcode" runat="server" Text="Postcode" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxPostcode">
                            <asp:RequiredFieldValidator ID="RequiredPostcode" runat="server" ErrorMessage="*"
                                SetFocusOnError="true" ForeColor="red" ControlToValidate="TextBoxPostcode" />
                        </asp:Label><asp:TextBox ID="TextBoxPostcode" CssClass="st-forminput" runat="server"
                            Width="150px"></asp:TextBox><asp:LinkButton ID="ButtonPostcodeLookup" runat="server"
                                CssClass="hg-blue" Text="Lookup" CausesValidation="False" />
                    </div>
                    <div class="half last">
                        <asp:Label ID="LabelFax" runat="server" Text="Fax" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxFax">
                        
                        </asp:Label><asp:TextBox ID="TextBoxFax" CssClass="st-forminput" runat="server" Width="200px"></asp:TextBox></div><div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="LabelCityTown" runat="server" Text="Town/Village/City" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxCityTown"></asp:Label><asp:TextBox ID="TextBoxCityTown"
                                CssClass="st-forminput" runat="server" Width="200px"></asp:TextBox></div><div class="half last">
                        <asp:Label ID="LabelEmail" runat="server" Text="Email" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxEmail"></asp:Label><asp:TextBox ID="TextBoxEmail" CssClass="st-forminput"
                                runat="server" Width="200px"></asp:TextBox></div><div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="LabelCounty" runat="server" Text="County" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxCounty"></asp:Label><asp:TextBox ID="TextBoxCounty" CssClass="st-forminput"
                                runat="server" Width="200px"></asp:TextBox></div><div class="half last">
                        <asp:Label ID="LabelWebAddress" runat="server" Text="County" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxWebAddress"></asp:Label><asp:TextBox ID="TextBoxWebAddress"
                                CssClass="st-forminput" runat="server" Width="200px"></asp:TextBox></div><div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        <asp:Label ID="LabelNationCounty" runat="server" Text="Natio/County" CssClass="st-labeltext level1"
                            AssociatedControlID="DropDownListNationCounty"></asp:Label><asp:DropDownList ID="DropDownListNationCounty"
                                runat="server" CssClass="st-forminput" Width="215px">
                            </asp:DropDownList>
                    </div>
                    <div class="half last">
                        <asp:Label ID="LabelCharityNumber" runat="server" Text="Charity Number" CssClass="st-labeltext level1"
                            AssociatedControlID="TextBoxCharityNumber"></asp:Label><asp:TextBox ID="TextBoxCharityNumber"
                                CssClass="st-forminput" runat="server" Width="200px"></asp:TextBox></div><div class="clear">
                    </div>
                </div>
                <div class="st-form-line-noleft">
                    <div class="half">
                        &nbsp; </div><div class="half last">
                        <asp:Label ID="LabelCompanyNumber" runat="server" Text="Company Number" CssClass="st-labeltext level1-5"
                            AssociatedControlID="TextBoxCompanyNumber" Width="101px"></asp:Label><asp:TextBox
                                ID="TextBoxCompanyNumber" CssClass="st-forminput" runat="server" Width="200px"></asp:TextBox></div><div class="clear">
                    </div>
                </div>
            </asp:Panel>
            <%--DETAIL PANEL TEAM--%>
            <asp:Panel ID="DetailsPanel02" ClientIDMode="Static" runat="server">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <div class="titleh">
                            <h3 class="sorting_range">
                                <asp:LinkButton ID="LinkButtonAll" runat="server" CssClass="hg-blue" CommandName="all"
                                    OnCommand="FilterByLetters_Command" CausesValidation="false">All</asp:LinkButton><asp:LinkButton
                                        ID="LinkButton09" runat="server" CommandName="09" OnCommand="FilterByLetters_Command"
                                        CausesValidation="False">0-9</asp:LinkButton><asp:LinkButton ID="LinkButtonAE" runat="server"
                                            CommandName="ae" OnCommand="FilterByLetters_Command" CausesValidation="False">A B C D E</asp:LinkButton><asp:LinkButton
                                                ID="LinkButtonFJ" runat="server" CommandName="fj" OnCommand="FilterByLetters_Command"
                                                CausesValidation="False">F G H I J</asp:LinkButton><asp:LinkButton ID="LinkButtonKN"
                                                    runat="server" CommandName="kn" OnCommand="FilterByLetters_Command" CausesValidation="False">K L M N</asp:LinkButton><asp:LinkButton
                                                        ID="LinkButtonOR" runat="server" CommandName="or" OnCommand="FilterByLetters_Command"
                                                        CausesValidation="False">O P Q R</asp:LinkButton><asp:LinkButton ID="LinkButtonSV"
                                                            runat="server" CommandName="sv" OnCommand="FilterByLetters_Command" CausesValidation="False">S T U V</asp:LinkButton><asp:LinkButton
                                                                ID="LinkButtonWZ" runat="server" CommandName="wz" OnCommand="FilterByLetters_Command"
                                                                CausesValidation="False"> W X Y Z</asp:LinkButton><span class="right"><asp:HyperLink
                                                                    ID="HyperLinkCreate" runat="server" CssClass="hg-blue" NavigateUrl="~/TeamMaintenance/AddTeam.aspx">Create</asp:HyperLink><asp:CheckBox
                                                                        ID="CheckBoxInactive" runat="server" Text="Include In-active" AutoPostBack="True"
                                                                        OnCheckedChanged="CheckBoxInactiveCheckedChanged" CausesValidation="false" /></span>
                            </h3>
                        </div>
                        <div class="clear">
                        </div>
                        <asp:GridView ID="GridViewTeam" CssClass="tablesorter" runat="server" AutoGenerateColumns="False"
                            DataSourceID="ObjectDataSourceTeam" AllowPaging="True" PageSize="15" AllowSorting="True">
                            <Columns>
                                <asp:TemplateField HeaderText="Team Name" SortExpression="TeamName">
                                    <ItemTemplate>
                                        <%--<asp:HyperLink 
                                            ID="HyperLink1" runat="server" NavigateUrl="" Text='<%# Eval("TeamName") %>'></asp:HyperLink>--%>
                                        <asp:LinkButton CommandArgument='<%#Eval("TeamId") %>' CommandName="EditAtribute"
                                            ID="LinkButtonTeamName" Text='<%#Eval("TeamName") %>' runat="server">
                                        </asp:LinkButton></ItemTemplate><HeaderStyle CssClass="header" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Address Line 1" SortExpression="Address">
                                    <ItemTemplate>
                                        <%#Eval("Address.AddressLine") %>
                                    </ItemTemplate>
                                      <HeaderStyle CssClass="header" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Postcode" SortExpression="Postcode">
                                    <ItemTemplate>
                                        <%#Eval("Address.PostCode") %>
                                    </ItemTemplate>
                                      <HeaderStyle CssClass="header" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Contact" SortExpression="Contact">
                                    <ItemTemplate>
                                        <%#string.Format("{0} {1}", Eval("Contact.FirstName"), Eval("Contact.Surname"))%></ItemTemplate>
                                    <HeaderStyle CssClass="header" />
                                    <ItemTemplate>
                                        <%#string.Format("{0} {1}", Eval("Contact.FirstName"), Eval("Contact.Surname"))%></ItemTemplate>
                                    <HeaderStyle CssClass="header" />
                                    <ItemTemplate>
                                        <%#string.Format("{0} {1}", Eval("Contact.FirstName"), Eval("Contact.Surname"))%></ItemTemplate>
                                    <HeaderStyle CssClass="header" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Is Active ?" SortExpression="Isactive">
                                    <ItemTemplate>
                                        <asp:Label ID="Label5" runat="server" Text='<%#(bool) Eval("IsActive") ? "Yes" : "No"%>'></asp:Label></ItemTemplate><HeaderStyle CssClass="header" />
                                </asp:TemplateField>
                            </Columns>
                            <PagerStyle CssClass="pagination_table"></PagerStyle>
                        </asp:GridView>
                        <asp:ObjectDataSource ID="ObjectDataSourceTeam" runat="server" SelectMethod="GetTeam"
                TypeName="AB.ServiceDirectory.BO.TeamBO" OnSelecting="ObjectDataSourceTeam_Selecting"
                EnablePaging="true" SelectCountMethod="GetTeamCount" StartRowIndexParameterName="startRowIndex"
                MaximumRowsParameterName="maxRows" SortParameterName="sortType">
                <SelectParameters>
                    <asp:Parameter Name="filter" Type="Object" ConvertEmptyStringToNull="false" />
                </SelectParameters>
            </asp:ObjectDataSource>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </asp:Panel>
            
        </div>
    </div>
</asp:Content>
